﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Framework.Platform.Components.UI.Authentication
{
    /// <summary>
    /// 登录界面的接口
    /// 这是平台登录界面必须实现的接口。
    /// </summary>
    public interface ILoginUI : IDisposable
    {
        /// <summary>
        /// 用户名
        /// </summary>
        string UserName { get; set; }
        /// <summary>
        /// 用户密码
        /// </summary>
        string Password { get; set; }
        /// <summary>
        /// 当提交登录请求
        /// </summary>
        event EventHandler<LoginUISubmitEventArgs> Submit;
        /// <summary>
        /// 当取消登录请求
        /// </summary>
        event EventHandler<EventArgs> Cancel;
        /// <summary>
        /// 关闭界面
        /// </summary>
        void HideUI();
        /// <summary>
        /// 显示界面
        /// </summary>
        void ShowUI();
        
        void LoginFailed(string errorMessage);
    }
}
